package com.rybbaby.tss.platform.sysAdminUserJoinSysMenuPermissions.service.imp;

import com.rybbaby.tss.core.web.service.imp.BaseServiceImp;
import com.rybbaby.tss.platform.sysAdminUserJoinSysMenuPermissions.entity.SysAdminUserJoinSysMenuPermissions;
import com.rybbaby.tss.platform.sysAdminUserJoinSysMenuPermissions.service.ISysAdminUserJoinSysMenuPermissionsService;
import com.rybbaby.tss.platform.sysHandlePermissions.service.ISysHandlePermissionsService;
import com.rybbaby.tss.platform.sysHandlePermissionsStyles.service.ISysHandlePermissionsStylesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author 谢进伟
 * @description 管理员所拥有的权限数据库操作服务实现
 * @createDate 2016-08-19 上午11:36:25
 */
@Service
@Transactional
public class SysAdminUserJoinSysMenuPermissionsServiceImp extends BaseServiceImp<SysAdminUserJoinSysMenuPermissions> implements ISysAdminUserJoinSysMenuPermissionsService {



	@Override
	public List<Map<String, Object>> adminUserIdDatasource() {
		String sql1 = "SELECT id,username FROM sys_admin_user";
		List<Map<String, Object>> adminUserId_datasources = this.findForJdbc(sql1, null);
		return adminUserId_datasources;
	}

	@Autowired
	private ISysHandlePermissionsStylesService sysHandlePermissionsStylesService;

	@Override
	public List<Map<String, Object>> menuPermissionIdDatasource() {
		String sql2 = "SELECT id,name FROM sys_menu_permissions";
		List<Map<String, Object>> menuPermissionId_datasources = this.findForJdbc(sql2, null);
		return menuPermissionId_datasources;
	}

	@Override
	public Serializable save(SysAdminUserJoinSysMenuPermissions entity) {
		Serializable newId = super.save(entity);
		return newId;
	}
}
